<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" >
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link th:href="@{/erp/assets/css/bootstrap.min.css}" rel="stylesheet"/>
    <link rel="stylesheet" th:href="@{/erp/css/style.css}"/>
    <link th:href="@{/erp/assets/css/codemirror.css}" rel="stylesheet">
    <link rel="stylesheet" th:href="@{/erp/assets/css/ace.min.css}"/>
    <link rel="stylesheet" th:href="@{/erp/assets/css/font-awesome.min.css}"/>
    <script th:src="@{/erp/assets/js/jquery.min.js}"></script>
    <script th:src="@{/erp/assets/js/bootstrap.min.js}"></script>
    <!-- page specific plugin scripts -->
    <script th:src="@{/erp/assets/js/jquery.dataTables.min.js}"></script>
    <script th:src="@{/erp/assets/js/jquery.dataTables.bootstrap.js}"></script>
    <script th:src="@{/erp/assets/layer/layer.js}" type="text/javascript"></script>
    <script th:src="@{/plugins/layui/layui.js}" type="text/javascript"></script>
</head>
<body>
<div class="add_menber" id="add_menber_style">
    <form>
        <ul class=" page-content">
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>仓库编号：</label>
                <div class="formControls ">
                    <input type="text" required  class="input-text" value="" placeholder="" id="warehouseNo" name="warehouseNo">
                </div>
            </div>
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>仓库名称：</label>
                <div class="formControls ">
                    <input type="text" required  class="input-text" value="" placeholder="" id="warehouseName" name="warehouseName">
                </div>
            </div>
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>负责人：</label>
                <div class="formControls ">
                    <input type="text" required  class="input-text" value="" placeholder="" id="warehousePerson" name="warehousePerson">
                </div>
            </div>
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>联系电话：</label>
                <div class="formControls ">
                    <input type="tel" required pattern="(\d{11})|^((\d{7,8})|(\d{4}|\d{3})-(\d{7,8})|(\d{4}|\d{3})-(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1})|(\d{7,8})-(\d{4}|\d{3}|\d{2}|\d{1}))$" class="input-text" value="" placeholder="" id="personTel" name="personTel">
                </div>
            </div>
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>详细地址：</label>
                <div class="formControls ">
                    <input type="text"  required  class="input-text" value="" placeholder="" id="address" name="warehouseAddress">
                </div>
            </div>
          <!--  <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>经纬度：</label>
                <div class="formControls ">
                    <input type="text" class="input-text" value="" placeholder="" id="user-name" name="经纬度"><a
                        data-toggle="tab" required id="area" href="#homerr">&nbsp;地理位置</a>
                </div>
            </div>-->
            <div class="Operate_cont clearfix">
                <label class="form-label"><span class="c-red">*</span>仓库详情：</label>
                <div class="formControls "><textarea required placeholder="" name="warehouseRemark"></textarea>
                </div>
            </div>
            <div class="" style=" text-align:center">
                <input class="btn btn-primary" id="tijiao" type="submit" value="提交">
                <input class="btn btn-primary" id="tijiao1" type="reset" value="取消">
            </div>
        </ul>
    </form>
</div>
<script>
    $(function () {
        $('form').submit(function () {
            var data = $('form').serialize();
            $.post('/warehouse/add',data, function (res) {
                if (res.rs) {
                    parent.layer.msg(res.msg, {icon: 1});
                    $('#btn',parent.window.document).click();
                    var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                    parent.layer.close(index); //再执行关闭
                } else {
                    layer.msg(res.msg, {icon: 2});
                }
            })
            return false;
        });
        $('#tijiao1').on('click', function () {
            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
            parent.layer.close(index); //再执行关闭
        });
    });
    
</script>
</body>
</html>